﻿#pragma once
namespace LK
{
	namespace Drawing
	{
		/**@brief 表示一个椭圆，T表示坐标数据的类型*/
		template<class T>class Ellipse
		{
		public:
			/**@brief 中心*/
			Point<T> pointCenter;
			/**@brief 横轴*/
			T a;
			/**@brief 纵轴*/
			T b;
			/**@brief 默认构造*/
			Ellipse(){}
			/**@brief 构造函数*/
			Ellipse(Point<T>const & p, T const &a, T const &b) :pointCenter(p), a(a), b(b){}
			Ellipse(T const & x, T  const &y, T const &a, T const &b) :pointCenter(x,y), a(a), b(b){}
			/**@brief 坐标正偏移*/
			inline friend Ellipse operator+(const Ellipse & p1, const Point<T> & p2){ return Ellipse(p1.pointCenter+p2, p1.a+ p2.b); }
			inline Ellipse & operator+=(const Point<T> & p){ return *this = *this + p; }
			inline Ellipse operator + (){ return *this; }
			/**@brief 坐标负偏移*/
			inline friend Ellipse operator-(const Ellipse & p1, const Point<T> & p2){ return Ellipse(p1.pointCenter - p2, p1.a + p2.b); }
			Ellipse & operator-=(const Point<T> & p){ return *this = *this - p; }
			inline Ellipse operator - (){ return Ellipse(-pointCenter,a,b); }
			/**@brief 坐标乘*/
			inline friend Ellipse operator*(const Ellipse & p, const T & i){ return Ellipse(p.pointCenter*i, p.a*i,p.b*i); }
			Ellipse & operator*=(const T & i){ return *this = *this * i; }
			/**@brief 坐标除*/
			inline friend Ellipse operator/(const Ellipse & p, const T & i){ return Ellipse(p.pointCenter/i, p.a/i, p.b/i); }
			Ellipse & operator/=(const T & i){ return *this = *this / i; }
		};

	}
}
